// 导入用户集合
const { Mood } = require('../../../model/mood');
const moment = require('moment')

module.exports = async (req, res) => {
	if(!req.body.publishDate) {
		req.body.publishDate = moment().format('YYYY-MM-DD HH:mm:ss')
	}
  Mood.create(req.body).then(item => {
    res.json({
        data: item,
        message: '添加成功！'
    })
  }).catch((err) => {
    res.status(403)
    res.json({
        log: err,
        message: '添加失败！'
    })
  })
}